
class Application{
  constructor(id, name, icon, x, y, url){
    this.id = id;
    this.show = {name, icon, url, choose: false};
    this.coordinate = {x, y};
    this.location = {x: 0, y: 0};
    this.style = {top: '0px', left: '0px'};
  }

  //设置页面坐标
  locate = function (x, y) {
    this.location.x = x;
    this.location.y = y;
    this.style.left = x + 'px';
    this.style.top = y + 'px';
  };

  //移动图标，移动的是网格坐标
  moveto = function (x, y) {
    this.coordinate.x = x;
    this.coordinate.y = y;
  };

  choosed = function () {
    this.show.choose = true;
  };

  dechoose = function () {
    this.show.choose = false;
  }
}

export {Application}
